home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 14 / Example 14.1 / Debug / Shaders / objects.ps < prev    next >
Encoding:
Text File  |  2006-06-22  |  841 b   |  20 lines

  1. //////////////////////////////////////////////////////////////////////////
  2. //                                                                      //
  3. //                    Terrain Object Pixexshader                        //
  4. //                                                                      //
  5. //                    Written by C. Granberg, 2006                      //
  6. //                                                                      //
  7. //////////////////////////////////////////////////////////////////////////
  8.  
  9. sampler diffuseText;
  10. sampler light;
  11.  
  12. float4 Main(float2 UV : TEXCOORD0, float2 worldUV : TEXCOORD1, float shade : TEXCOORD2) : COLOR
  13. {
  14.     //Sample the textures
  15.     float4 col  = tex2D(diffuseText, UV);
  16.     float4 l    = tex2D(light, worldUV); 
  17.  
  18.     //Return result
  19.     return col * shade * l;
  20. }